<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglibs.jsp" %>

<%@page import="util.ftp.*"%>
<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%@page import="service.BillServices"%>
<%@page import="vo.Bill"%>


<%@page import="util.ftp.impl.apacheFtp"%>
<%@page import="util.ftp.IFtp"%>
<%@page import="util.ftp.impl.sunFtp"%><html>
	<head>
		<title>Insert title here</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	</head>
<body>
	<%
		//ArrayList<Hashtable> items = Ftp.getFile();	
		IFtp ftp = new apacheFtp();
		//IFtp ftp = new sunFtp();
		ArrayList<Hashtable> items = ftp.getFile(); 
	%>
	<%=items.size() %>
	<%	
		BillServices billService = new BillServices();
		billService.importBills(items);
		List bills = billService.listAllBill();
		pageContext.setAttribute("bills", bills);
	%>
	<table border=1>
      <c:forEach var="bill" items="${bills}">
        <tr>
          <td>${bill.LIPI_NAME}
          </td>
          <td>
          	<c:out value="${bill.LIPM_NAME}" escapeXml="false"/>
          </td>
        </tr>
      </c:forEach>
    </table>
	
	Bill.Size=<%=bills.size() %>	
</body>
</html>